#!/bin/bash

# 获取当前脚本的位置
shell_home="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

# 切换到脚本的位置
cd $shell_home

source /etc/profile

# 获取时间参数
ds=$1
hive -f ../hive_ddl/ads_in_station_day_top.sql

hive -f ../hive_dql/ads_in_station_day_top.sql -d ds=${ds}

clickhouse-client --host localhost \
--port 9001 \
--password 123456  \
--query "CREATE TABLE IF NOT EXISTS ads.ads_in_station_day_top (day String COMMENT '数据产生日期',station String COMMENT '站点',count String COMMENT '人数',ds String COMMENT '分区字段')ENGINE = MergeTree ORDER BY ds;"



datax.py -p "-Dds=${ds}" ../datax_json/ads_in_station_day_top.json